package com.tc.gateway.tunnel;

import java.io.IOException;
import java.io.OutputStream;

import com.tc.multicast.NativeTunnelClient;
import com.tc.multicast.NativeTunnelServer;

public class TunnelManager {
	static String protocol = "udp";
	static public TunnelServer getServer(OutputStream stream) throws IOException{
		if(protocol.equals("udp"))
			return new MultiTunnelServer(stream);
		else if(protocol.equals("native"))
			return  new NativeTunnelServer(stream);
		else	return  new TcpTunnelServer(stream, (short)8888);
	}
	static public TunnelClient getClient(String ip, short port) throws IOException{
		if(protocol.equals("udp"))

				return new MultiTunnelClient();
		else if(protocol.equals("native"))
			return new NativeTunnelClient();
		else

				return  new TcpTunnelClient(ip,port);
			
	}
}
